<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<c:set value="${pageContext.request.contextPath}" var="path"/>
<head>
    <style>
        #logout-btn {
            display: none;
        }
    </style>
</head>
<body>

<div id="header">
    <div class="topnav">
        <div class="w1200 clearfix">
            <%--<span class="fleft">--%>
                <%--<input type="text" class="searchbox" id="msg_j"--%>
                       <%--style="height: 20px;line-height: 46px;border-radius: 5px"/>--%>
                <%--<i class="iconfont" style="font-size: 22px;margin-top: 10px;margin-right: -1px;cursor: pointer">&#xF010;</i>--%>
                <%--<span id="searchit" style="font-size: 16px;line-height: 46px;cursor: pointer">搜索</span>--%>
            <%--</span>--%>
            <span class="fright login" id="login-btn">
                <a href="${path}/userapi/tofrontlogin/login"
                   id="Login_start">登录</a>
                 <a href="${path}/userapi/tofrontlogin/register"
                    id="reg_start">注册</a>
            </span>
            <span class="fright login" id="logout-btn">
                <a href="${path}/usercenterapi/userCenter" id="loginout">
                    ${sessionScope.userInfo.userName != null ? sessionScope.userInfo.userName : sessionScope.userInfo.tel}
                </a>
                <a class="ft12" href="${path}/login/loginout">退出</a>
            </span>
        </div>

    </div>
    <div class="w1200">
        <div class="snav">
            <div class="w1200">
                <a class="logobox" href="${path}/home" title="舒客Seeker--旅行，旅居，旅友">
                    <strong>舒客<span>Seeker<i>&reg;</i></span></strong><span>旅行&nbsp;&sdot;&nbsp;旅居&nbsp;&sdot;&nbsp;旅友</span>
                </a>
            </div>
        </div>
        <div class="navtab">
            <a class="" href="${path}/home"><i class="iconfont">&#xF000;</i>首页</a>
            <a href="${path}/recommend"><i class="iconfont">&#xF002;</i>LeisureSeeker</a>
            <a href="${path}/seeker/map"><i class="iconfont">&#xF002;</i>路线规划</a>
            <%--<a href="${path}/route">
                <i class="iconfont">&#xF011;</i><span>旅居</span>线路</a>--%>
            <a href="${path}/sharing"><i class="iconfont">&#xF001;</i><span>旅友</span>分享</a>
        </div>
        <!-- 上面有写绝对路径的先不要改，做测试用 -->
    </div>
</div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
    $('#searchit').click(function () {
        var scenic = $('#msg_j').val();
        if (scenic != "") {
            location.href = "${path}/scenics/" + scenic + "/0";
        }
    });
</script>
<script type="text/javascript">
    // 设置主页按钮颜色
    var flag = "${flag}";
    switch (flag) {
        case 'home':
            $('.navtab a:eq(0)').attr('class', 'current');
            break;
        case 'area':
            $('.navtab a:eq(1)').attr('class', 'current');
            break;
        case 'sharing':
            $('.navtab a:eq(3)').attr('class', 'current');
            break;
    }
</script>
<!-- 前端登录后session验证 -->
<script type="text/javascript">
    //session验证及保存
    $(function () {
        if (${sessionScope.userInfo != null}) {
            $("#login-btn").hide();
            $("#logout-btn").show();
        }
    })
</script>
</body>
</html>